package com.tiandao.mofang.core.richang;

import com.tiandao.mofang.core.RobotSingleton;
import com.tiandao.mofang.core.role.BaseRole;
import com.tiandao.mofang.core.util.YiDong;
import com.tiandao.mofang.ui.MFFrame;

import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.Date;

/**
 *东岳香蝶林  倪庄旧怨 (林月娘)
 * 和怪对话才能通过  怪头上有红色眼睛
 */
public class DyXdNzjy implements Runnable{

    private static Robot robot = RobotSingleton.getInstance();

    public static void main(String[] args) {
            start();
    }
    @Override
    public void run() {
        start();
    }

    //开始的方法
    public static void start(){
        //按下M 去杭州
        try {
            Thread.sleep(5000);
            YiDong.yfsxqdt(669,207,YiDong.QDT_DONG_YUE_Y);
            Thread.sleep(15000);
            MFFrame.textArea.append(new Date()+":    到达东越!\n");
            robot.keyPress(KeyEvent.VK_6);
            robot.keyRelease(KeyEvent.VK_6);
            Thread.sleep(1500);
            YiDong.zouLu("755","3105");
            Thread.sleep(42000);
            MFFrame.textArea.append(new Date()+":    到达任务地点!\n");
            robot.keyPress(KeyEvent.VK_F);
            robot.keyRelease(KeyEvent.VK_F);
            Thread.sleep(2500);
            robot.mouseMove(240,548);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            Thread.sleep(1500);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
            for(int x= 0;x<=9;x++){
                YiDong.zouLu("760","3052");
                Thread.sleep(10000);
                robot.keyPress(KeyEvent.VK_F);
                robot.keyRelease(KeyEvent.VK_F);
                Thread.sleep(2500);
                robot.mouseMove(240,548);
                Thread.sleep(1500);
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
                Thread.sleep(1500);
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
                Thread.sleep(1500);
                robot.keyPress(KeyEvent.VK_1);
                robot.keyRelease(KeyEvent.VK_1);
                Thread.sleep(800);
                robot.keyPress(KeyEvent.VK_2);
                robot.keyRelease(KeyEvent.VK_2);
                Thread.sleep(800);
                robot.keyPress(KeyEvent.VK_4);
                robot.keyRelease(KeyEvent.VK_4);
                Thread.sleep(800);
                robot.keyPress(KeyEvent.VK_3);
                robot.keyRelease(KeyEvent.VK_3);
                Thread.sleep(800);
                robot.keyPress(KeyEvent.VK_5);
                robot.keyRelease(KeyEvent.VK_5);
                YiDong.zouLu("748","3028");
                Thread.sleep(10000);
                robot.keyPress(KeyEvent.VK_F);
                robot.keyRelease(KeyEvent.VK_F);
                Thread.sleep(2500);
                robot.mouseMove(240,548);
                Thread.sleep(1500);
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
                Thread.sleep(1500);
                robot.mousePress(InputEvent.BUTTON1_MASK);
                robot.mouseRelease(InputEvent.BUTTON1_MASK);
                Thread.sleep(1500);
                robot.keyPress(KeyEvent.VK_1);
                robot.keyRelease(KeyEvent.VK_1);
                Thread.sleep(800);
                robot.keyPress(KeyEvent.VK_2);
                robot.keyRelease(KeyEvent.VK_2);
                Thread.sleep(800);
                robot.keyPress(KeyEvent.VK_4);
                robot.keyRelease(KeyEvent.VK_4);
                Thread.sleep(800);
                robot.keyPress(KeyEvent.VK_3);
                robot.keyRelease(KeyEvent.VK_3);
                Thread.sleep(800);
                robot.keyPress(KeyEvent.VK_5);
                robot.keyRelease(KeyEvent.VK_5);
            }


            MFFrame.textArea.append(new Date()+":    日常完成!\n");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
